package com.dy.project.service.impl;

import com.dy.project.domain.McCommodity;
import com.dy.project.mapper.McCommodityMapper;
import com.dy.project.service.IMcCommodityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-13
 */
@Service
public class McCommodityServiceImpl implements IMcCommodityService
{
    @Autowired
    private McCommodityMapper mcCommodityMapper;

    /**
     * 查询商品
     * 
     * @param acId 商品ID
     * @return 商品
     */
    @Override
    public McCommodity selectMcCommodityById(Long acId)
    {
        return mcCommodityMapper.selectMcCommodityById(acId);
    }

    /**
     * 查询商品列表
     * 
     * @param mcCommodity 商品
     * @return 商品
     */
    @Override
    public List<McCommodity> selectMcCommodityList(McCommodity mcCommodity)
    {
        Object actIds = mcCommodity.getParams().get("actIds");
        if(actIds != null){
            mcCommodity.getParams().put("actIds", actIds.toString().split(","));
        }
        return mcCommodityMapper.selectMcCommodityList(mcCommodity);
    }
}
